<template>
	<view class="mainpopup">
		<u-mask :show="show" @click="show = false" :mask-click-able="maskclickable">
			<view class="warp">
				<view class="rect" @tap.stop>
					<view class="titletip">温馨提示</view>
					<view class="contenttip">
						{{content}}
					</view>
					<view class="qd" @click.stop="queding" v-if="tip !=1">
						确定
					</view>
					<view class="qb" @click.stop="queding" v-if="tip ==1">
						<view class="quxiao" @click.stop="quxiao">
							取消
						</view>
						<view class="queding" @click.stop="queding">
							确定
						</view>
					</view>
				</view>
			</view>
		</u-mask>
	</view>
</template>

<script>
	export default {
		name: "Popup",
		props: {
			content: {
				type: String,
				default: () => ""
			},
			tip: {
				type: String,
				default: () => ""
			},
		},
		data() {
			return {
				show: true,
				maskclickable: false,
			};
		},
		methods: {
			queding() {
				this.show = false
				this.$emit('showshow', this.show)

			},
			quxiao() {
				this.show = false
				this.$emit('showqx', this.show)
			}
		}
	}
</script>

<style lang="less" scoped>
	.mainpopup {

		.warp {
			display: flex;
			align-items: center;
			justify-content: center;
			z-index: 999;
			height: 100%;


			.rect {
				width: 546rpx;
				height: 278rpx;
				background: #FFFFFF;
				border-radius: 16rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				align-items: center;

				.titletip {
					font-weight: 600;
					font-size: 28rpx;
					color: #000000;
				}

				.contenttip {
					width: 70%;
					color: #000000;
					font-weight: 400;
					text-align: center;
				}

				.qd {
					width: 182rpx;
					height: 64rpx;
					background: linear-gradient(126.72deg, #FFB38E 0%, #F84A52 100%);
					border-radius: 80rpx;
					color: #FFF;
					text-align: center;
					line-height: 64rpx;
				}

				.qb {
					width: 80%;
					height: 64rpx;
					display: flex;
					justify-content: space-around;

					.quxiao {
						width: 162rpx;
						height: 60rpx;
						background: #ccc;
						border-radius: 80rpx;
						color: #FFF;
						text-align: center;
						line-height: 60rpx;
					}

					.queding {
						width: 162rpx;
						height: 60rpx;
						background: linear-gradient(126.72deg, #FFB38E 0%, #F84A52 100%);
						border-radius: 80rpx;
						color: #FFF;
						text-align: center;
						line-height: 60rpx;
					}
				}
			}
		}
	}
</style>